Repository navigation
perf(streams): avoid repeated growing-buffer prefix extraction in SSE decoding - #7676
Conversation
Avoid re-slicing the growing line buffer for every incoming fragment. Keep at most six code units for field classification and reset on each accepted line, preserving existing UTF-8 accounting and admission order. Add fragmented-prefix, Unicode, operation-count and failure-cleanup tests. Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
…rk770-dev-bd5-20261024
|
Caution Review failedThe pull request is closed. Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ Deterministic PR hygiene checks passed. |
|
Integration evidence (owner decision decision:e6895606, approved): independent gpt-6.1-sol review PASS at c7607ae (bounded six-code-unit prefix, fragmented/Unicode coverage, admission-failure cleanup). Exact-head CI run 40079749137 succeeded: four Ubuntu test shards, gates and aggregate ci. Not Windows-sensitive. Static merge simulation on current dev d0a8443 (this Mac): dev=d0a84439cee1427cc02397f54084aa3d145eda04 base=bd5c2ea906741a4201c6f35bb180e7a9a112a4fd pr_files= 2 overlap=[]; merge clean; install exit=0; gui install exit=0; tsc exit=0; tsc doctor exit=0; structure:check exit=0; privacy:scan exit=0; layout+ratchet guards exit=0 52 pass 0 fail ; Merged by the triage manager as maintainer integration (MAINTAINERS.md, dev only) with green exact-head PR CI, an independent review PASS, and the owner's approval of this bundle. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Brings the PR7635 follow-up candidate onto current dev (SSE field prefix fix lidge-jun#7676 and ancestors). Clean merge; the two review-nit changes are unchanged.
Summary
Keep only the bounded six-code-unit prefix needed to recognize an SSE
data:field instead of repeatedly extracting that prefix from a growing line. Update the prefix after accepted appends and reset it at each accepted line.Preserve CR, LF and split-CRLF handling, UTF-8 decoding, byte accounting, event limits and translator-budget admission/release. Extend regressions for fragmented long lines, multilingual fields and failure cleanup.
Verification
c7607ae0e41d971529ba05b731945b73b8735953normally merges source4771faba9eaf395e9ba58e83c185a1dee1b3e26fwithdev@bd5c2ea906741a4201c6f35bb180e7a9a112a4fd. Both change-owned blobs are unchanged; root/GUI dependency inputs match dev.CI=1:bun test --isolate --timeout 60000 tests/responses/sse-carriage-return.test.ts tests/responses/sse-decoder.test.ts— 25 passed / 0 failed / 277 assertions. This includes acceptance at exactly 32 MiB and rejection at one byte above the limit.Checklist
Co-authored-by: luvs01 27862058+luvs01@users.noreply.github.com